﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DLV.Utilities;

namespace DLV.Data.Entities
{
    public class CalculatorController
    {
        public int InsertCalculator(CalculatorInfo info)
        {
            return SQL.InsertCalculator(info.TourId, info.ItemId, info.ItemType, info.DateBegin, info.DateEnd, info.PriceAdults, info.PriceChild, info.QuantityCar, info.QuantityAdults, info.QuantityChild,info.Vat, info.TranslateAdult,info.TranslateChild,info.OtherCostAdult,info.OtherCostChild,info.TravelGuideType);
        }
        public void UpdateCalculator(CalculatorInfo info)
        {
            SQL.UpdateCalculator(info.CalculatorId, info.TourId, info.ItemId, info.ItemType, info.DateBegin, info.DateEnd, info.PriceAdults, info.PriceChild, info.QuantityCar, info.QuantityAdults, info.QuantityChild, info.Vat, info.TranslateAdult, info.TranslateChild, info.OtherCostAdult, info.OtherCostChild, info.TravelGuideType);
        }
        public void DeleteCalculator(CalculatorInfo info)
        {
            DeleteCalculator(info.CalculatorId);
        }
        public void DeleteCalculator(int calculatorId)
        {
            SQL.DeleteCalculator(calculatorId);
        }
        public CalculatorInfo GetCalculator(int calculatorId)
        {
            return CBO.FillObject<CalculatorInfo>(SQL.GetCalculator(calculatorId));
        }
        public CalculatorInfo GetCalculatorDvk(int calculatorId)
        {
            return CBO.FillObject<CalculatorInfo>(SQL.GetCalculatorDvk(calculatorId));
        }
        public List<CalculatorInfo> ListCalculator()
        {
            return CBO.FillCollection<CalculatorInfo>(SQL.ListCalculator());
        }
        public List<CalculatorInfo> ListCalculatorDvk()
        {
            return CBO.FillCollection<CalculatorInfo>(SQL.ListCalculatorDvk());
        }
        public DataTable SelectCalculator()
        {
            return CBO.ConvertToDataTable(ListCalculator(), typeof(CalculatorInfo));
        }
       
    }
}
